﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Login" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Your Invocemanager</title>
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
    <script type="text/javascript">
        jQuery(function ($) {

            // simple jQuery validation script
            $('#login').submit(function () {

                var valid = true;
                var errormsg = 'This field is required!';
                var errorcn = 'error';

                $('.' + errorcn, this).remove();

                $('.required', this).each(function () {
                    var parent = $(this).parent();
                    if ($(this).val() == '') {
                        var msg = $(this).attr('title');
                        msg = (msg != '') ? msg : errormsg;
                        $('<span class="' + errorcn + '">' + msg + '</span>')
                            .appendTo(parent)
                            .fadeIn('fast')
                            .click(function () { $(this).remove(); });
                        valid = false;
                    };
                });
                return valid;
            });
        })	
    </script>
    <link href="Log_Reg.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="login" runat="server">
    <div>
        <asp:Image runat="server" alt="Invoice manager" longdesc="Invoice manager" ImageUrl="~/Images/Logo.jpg" />
    </div>
    <p class="register">
        <a href="Registration.aspx">Register</a>
    </p>
    <div>
        <label>
            Username</label>
        <asp:TextBox ID="tb_login" runat="server" class="field required" title="Please provide your username"></asp:TextBox>
    </div>
    <div>
        <label>
            Password</label>
        <asp:TextBox ID="tb_password" runat="server" TextMode="Password" class="field required"
            title="Password is required"></asp:TextBox>
    </div>
    <div class="submit">
        <asp:Button ID="Button1" Text="Log in" runat="server" OnClick="LogIn_Clicked" />
        <label>
            <asp:CheckBox runat="server" ID="RememberMe" />
            Remember my login on this computer
        </label>
    </div>
    <p class="back">
        <asp:Literal Text="Log in unsuccessful" runat="server" Visible="false" ID="ErrorMessage" />
    </p>
    </form>
</body>
</html>
